import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

import org.apache.hadoop.io.Writable;


public class PairDataPartB implements Writable{

	private String firstWord;
	private String secondWord;
	private double pmi;
	private boolean inTrueWords;
	
	
	
	public PairDataPartB(String firstWord, String secondWord, double pmi,
			boolean inTrueWords) {
		this.firstWord = firstWord;
		this.secondWord = secondWord;
		this.pmi = pmi;
		this.inTrueWords = inTrueWords;
	}

	@Override
	public void readFields(DataInput in) throws IOException {
		String s = in.readUTF();
		String[] arr = s.split("\t");
		this.firstWord = arr[0];
		this.secondWord = arr[1];
		this.pmi = Double.valueOf(arr[2]);
		this.inTrueWords = Boolean.valueOf(arr[3]);		
	}
	
	@Override
	public void write(DataOutput out) throws IOException {
		
		out.writeUTF(this.firstWord + "\t" + this.secondWord + "\t"
				+ this.pmi + "\t" + this.inTrueWords);
	}

	public String getFirstWord() {
		return firstWord;
	}

	public String getSecondWord() {
		return secondWord;
	}

	public double getPmi() {
		return pmi;
	}

	public boolean isInTrueWords() {
		return inTrueWords;
	}
	
	
	
}
